<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
					
					var stu2 = {
						id:2,
						name:"王五",
						age:19
					}
					
					// 1. for ... in .
					
					for(var i in stu2)
					{
						document.write(i+","+stu2[i]+"<br />")
					}
					
					// 2. with 语句 (在with语句块中 可以省略不写 stu2)
					with(stu2)
					{
						document.write(id+","+name+","+age);
					}
					
					
					
					
				</script>
	</body>
</html>
